﻿using RestSharp;
using System;
using System.Collections.Generic;
using System.Text;

namespace ACSynologyHelper
{
    public class SynologyConf
    {
        /// <summary>
        /// 服务器地址
        /// </summary>
        public static string SynologyURL { get; set; }

        public static RestClient RClient { get; set; }
        public static RestRequest RRequest { get; set; }

        public static string SID { get; set; }

        public static IList<RestResponseCookie> Cookies { get; set; }

        public static List<Parameter> ParameterCookies
        {
            get
            {
                if(Cookies is null)
                {
                    return new List<Parameter>();
                }
                List<Parameter> lp = new List<Parameter>();
                foreach (var item in Cookies)
                {
                    lp.Add(new Parameter(item.Name, item.Value, ParameterType.Cookie));
                }
                return lp;
            }
        }
    }
}
